package com.vchello.service.impl.agency;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.vchello.bean.agency.AgencyApplyRemark;
import com.vchello.dao.agency.AgencyApplyRemarkDao;
import com.vchello.service.agency.AgencyApplyRemarkService;

/**
 * 
 * @author lmq
 *
 */
@Service(value = "agencyApplyRemarkService")
public class AgencyApplyRemarkServiceImpl extends ServiceImpl<AgencyApplyRemarkDao, AgencyApplyRemark> implements AgencyApplyRemarkService {

	@Autowired
	private AgencyApplyRemarkDao agencyApplyRemarkDao;
	
	@Override
	public Integer saveAgencyApplyRemark(AgencyApplyRemark entity) {
		return agencyApplyRemarkDao.insert(entity);
	}

	@Override
	public Integer updateAgencyApplyRemark(AgencyApplyRemark entity) {
		return agencyApplyRemarkDao.updateById(entity);
	}

	@Override
	public Page<AgencyApplyRemark> findAgencyApplyRemarkByPage(Page<AgencyApplyRemark> page, AgencyApplyRemark agencyApplyRemark) {
		Wrapper<AgencyApplyRemark> wrapper = new EntityWrapper<AgencyApplyRemark>(agencyApplyRemark);
		return selectPage(page, wrapper);
	}

	@Override
	public AgencyApplyRemark findAgencyApplyRemarkById(int id) {
		return agencyApplyRemarkDao.selectById(id);
	}

	@Override
	public boolean deleteAgencyApplyRemark(AgencyApplyRemark entity) {
		try {
			agencyApplyRemarkDao.deleteById(entity);
			return true;
		} catch (Exception e) {
			return false;
		}
	}

}
